{{define "title"}}Wiki索引{{end}}
{{define "content"}}
<div class="row">
  <div class="col-md-9 col-sm-6">
    <div class="sep20"></div>
    <ol class="breadcrumb">
      <li><a href="/">首页</a></li>
      <li class="active">Wiki索引</li>
    </ol>
    {{range .wikis}}
    <article class="article box_white">
      <div class="row">
        <div>
          <h2><a href="/wiki/{{.Uri}}" target="_blank" title="{{.Title}}">
            {{.Title}}
          </a></h2>
          <p class="text">{{substring .Content 250 "..."}}<a href="/wiki/{{.Uri}}" target="_blank" title="阅读全文">阅读全文</a></p>
        </div>
      </div>
      <div class="row">
        <div class="col-md-8 metatag">
          <i class="glyphicon glyphicon-calendar"></i>
          <span class="date" title="发布日期">{{.Ctime}}</span>
          <i class="glyphicon glyphicon-user"></i>
          <span class="author" title="作者">{{$user := index .Users .Uid}}{{$user.Username}}</span>
        </div>
        <div class="col-md-4 metatag text-right">
          <span class="view" title="阅读数">
            <i class="glyphicon glyphicon-eye-open"></i>
            阅读:<span>{{.Viewnum}}</span>次
          </span>
        </div>
      </div>
    </article>
    {{end}}
    <ul class="pager">
      {{if .page.has_prev}}
      <li class="previous"><a href="/wiki?lastid={{.page.prev_id}}">&larr; 上一页</a></li>
      {{end}}
      {{if .page.has_next}}
      <li class="next"><a href="/wiki?lastid={{.page.next_id}}">下一页 &rarr;</a></li>
      {{end}}
    </ul>
  </div>
  <div class="col-lg-3 col-md-4 col-sm-5">
    <div class="sep20"></div>

    {{include "common/my_info.html" .}}

    {{include "sidebar/article.html" .}}
    {{include "sidebar/topic.html" .}}

  </div>

</div>
{{end}}
{{define "js"}}
<script type="text/javascript">
// 需要加载的侧边栏
SG.SIDE_BARS = [
  "/topics/recent",
  "/articles/recent",
];
</script>
{{end}}